using UnityEngine;

public class ActivatableButton : MonoBehaviour
{
	private Collider btnCollider;

	private UIWidget widget;

	public void SetActiveButton(bool val)
	{
		if (btnCollider == null)
		{
			btnCollider = GetComponent<Collider>();
		}
		if (widget == null)
		{
			widget = GetComponent<UIWidget>();
		}
		if (btnCollider != null)
		{
			btnCollider.enabled = val;
		}
		if (widget != null)
		{
			GetComponent<UIWidget>().alpha = ((!val) ? 0.5f : 1f);
		}
	}

	public void SwitchCollider(bool val)
	{
		if (btnCollider == null)
		{
			btnCollider = GetComponent<Collider>();
		}
		if (btnCollider != null)
		{
			btnCollider.enabled = val;
		}
	}
}
